<template>
  <div>
    <button type="button" @click="addShopItem">模拟新增商品</button>
    <button type="button" @click="editShopItem">直接修改父组件的shop值</button>
  </div>
</template>

<script setup lang="ts">
// import { ref } from 'vue'
import { type Info } from './StuDemo4.vue'
const porps = defineProps<{
  spxj: Info[]
}>()
// const arrinfos = ref<Info[]>(spxj)
const emit = defineEmits(['addShop', 'editShop'])
const addShopItem = () => {
  emit('addShop')
}
const editShopItem = () => {
  emit('editShop', 150)
}
</script>

<style></style>
